# Archlive <http://archlive-pkg.googlecode.com>
#  You must "makepkg -g >>./PKGBUILD" firstly if you use pacman version 3.3
#  Then  "makepkg"
#

pkgname=kernel26-fedora-pae
pkgver=2.6.31
pkgrel=23.fc12
url="http://www.kernel.org/"
pkgdesc="The Linux Kernel and modules, compiled by Fedora. PAE supported. (Memory >= 4GB)"
arch=('i686' 'x86_64')
license=('GPL2')
depends=('coreutils' 'module-init-tools' 'mkinitcpio>=0.5.15')
makedepends=('rpmextract')
backup=(etc/mkinitcpio.d/kernel26.preset)
provides=("kernel26=$pkgver" "kernel26-fedora-pae=$pkgver")
conflicts=('kernel24' 'kernel24-scsi' 'kernel26-scsi' 'kernel26' 'kernel26-fedora')

install=kernel26-fedora.install
source=(http://kojipkgs.fedoraproject.org/packages/kernel/${pkgver}/${pkgrel}/${CARCH}/kernel-PAE-${pkgver}-${pkgrel}.${CARCH}.rpm
	kernel26-fedora.preset)
md5sums=()

build()
{
	cd $pkgdir
	rpmextract.sh $srcdir/kernel-PAE-${pkgver}-${pkgrel}.${CARCH}.rpm
	rm -rf $pkgdir/etc/ld.so.conf.d
	rm -rf $pkgdir/usr
	# Install mkinitcpio files
	msg "Installing preset file..."
	install -D -m644 "$srcdir/kernel26-fedora.preset" \
		"$pkgdir/etc/mkinitcpio.d/kernel26-fedora.preset" || return 1
	msg "Generating kernel26-fedora.kver..."
	_kernver=${pkgver}-${pkgrel}.${CARCH}.PAE
	echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" \
		> "$pkgdir/etc/mkinitcpio.d/kernel26-fedora.kver" || return 1
}
